#pragma once
namespace xs {

	template<class T>
	struct list_node
	{
		T _data;
		list_node<T>* _next;
		list_node<T>* _prev;

		list_node(const T& data = T())
			:_data(data)
			, _next(nullptr)
			, _prev(nullptr)
		{}
	};
	


	template<class T>
	class list {
		typedef list_node<T> Node;
		
	public:
	
		list()
		{
			_head = new Node;
			_head->_next = _head;
			_head->_prev = _head;

			_size = 0;
		}

		/*void push_back(const T& x) {
			Node* newnode = new Node(x);
			Node* tail = _head->_next;

			tail->next = _head->prev;
			newnode->_prev = tail;
			newnode->_next = _head;
			_head->_prev = newnode;
		}*/

		
		size_t size() const{
			return _size;
		}
		bool empty() const{
			return _size == 0;
		}
	private:
		Node _head;
		size_t _size;
	};
	
}